<template>
  <el-image
    style="height: 100%;
    width: 100%; z-index: 9999;"
    :src="Array.isArray(src) ? picFunc(src[0]) : picFunc(src)"
    :alt="alt"
    :referrer-policy="referrerPolicy"
    :fit="fit"
  >
  </el-image>
</template>

<script setup lang="ts" name="vImage">
import {defineProps } from 'vue'
const props = defineProps({
  // 图片地址
  src: String,
  // 图片alt
  alt: String,
  referrerPolicy: String,
  fit: String,
})
// 处理服务器的图片路径
const picFunc = (url) => {
  if (Array.isArray(url)) {
    return url.map(val => {
      return val
    })
  } else {
    return url
  }
}

</script>

<style scoped lang="scss">

</style>